﻿Partial Class DBFDataTable
    Private FILLEXPRESSION As Linq.Expressions.Expression = Nothing
    Public Sub Fill()
        Call Me.FillDataTableRows()
    End Sub
    Public Sub Fill(ByVal expression As Linq.Expressions.Expression)
        Me.FILLEXPRESSION = expression
        Call Me.Fill()
    End Sub
    Private Sub FillDataTableRows()
        For X As Int32 = 0 To MY_DBFFile.RecordCount - 1
            Dim Record As Record = MY_DBFFile.InternalGetRecord(X, False)
            If Record Is Nothing Then Continue For
            '
            Dim NewRow As Data.DataRow = Me.NewRow
            For Y As Int32 = 1 To MY_DBFFile.Columns.Count - 1
                NewRow.Item(Y - 1) = Record.GetField(Y)
            Next Y
            Try
                Me.Rows.Add(NewRow)
            Catch
            End Try
        Next X
    End Sub
    'Private Function GetRecordByRow(rowNo As Int32) As DbfRecord
    'Dim record As DbfRecord = Nothing
    '   If Me.DBFINDEX Is Nothing Then
    '      record = DBFTABLE.GetRecord(rowNo)
    '  Else
    '     record = Me.DBFINDEX.GetRecord(rowNo)
    '    End If
    '   Return record
    ' End Function
End Class